home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 June / PCWorld_2007-06_cd.bin / v cisle / pcwmultiboot / pcwMultiboot.exe / BootCD / MyBootCD / boot / scripts / mouse.scr < prev    next >
Text File  |  2004-05-08  |  2KB  |  70 lines

  1. #
  2. # Sample script demonstrating mouse usage.
  3. # For CD Shell 2.0, May 2004
  4. #
  5.  
  6. #--------------------------------------------------------------------------
  7. # Check for mouse availablity.
  8. if !$mouse
  9.     then print "\n\nSorry, no mouse was detected.\n\n"
  10.     then end
  11.  
  12.  
  13. #--------------------------------------------------------------------------
  14. # Display menu.
  15.  
  16. set textColor = color[brightgrey on black]
  17. set boldColor = color[brightcyan on black]
  18. cls
  19. set textCursorY = 1
  20. print c "CD Shell Mouse Interface Sample Script"
  21. set textCursorX = 0
  22. set textCursorY = 11
  23. print " Please select an option:\n"
  24. print "   1. Toggle mouse visibility\n"
  25. print "   2. Cycle mouse cursor color\n"
  26. print "   3. Quit"
  27.  
  28. menuLoopUpdate:    call updateStatus
  29. menuLoop:          mgetkey
  30.  
  31. if $lastKey == key[1]
  32.     then set mouseVisible = $mouseVisible ^^ 1
  33.     then goto menuLoopUpdate
  34. if $lastKey == key[2]
  35.     then set mouseColor = $mouseColor + 0x10
  36.     then goto menuLoop
  37. if $lastKey == key[3]
  38.     then cls
  39.     then end
  40. if $lastKey == key[mouse]
  41.     then goto menuLoopUpdate
  42.     else goto menuLoop
  43.  
  44.  
  45. #--------------------------------------------------------------------------
  46. # Update mouse status information display.
  47.  
  48. updateStatus:
  49. set textCursorX = 0
  50. set textCursorY = 3
  51. print "Mouse cursor is "
  52. if $mouseVisible
  53.     then print "visible.\n"
  54.     else print "hidden. \n"
  55. print "Mouse pointer x position: \cXX$mouseCursorX \n"
  56. print "Mouse pointer y position: \cXX$mouseCursorY \n"
  57. print "Mouse left button status: "
  58. if $mouseButtonLeft
  59.     then print "\cXXPressed    \n"
  60.     else print "\cXXNot Pressed\n"
  61. print "Mouse middle button status: "
  62. if $mouseButtonMiddle
  63.     then print "\cXXPressed    \n"
  64.     else print "\cXXNot Pressed\n"
  65. print "Mouse right button status: "
  66. if $mouseButtonRight
  67.     then print "\cXXPressed    \n"
  68.     else print "\cXXNot Pressed\n"
  69. return
  70.